package cn.tedu._07springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CaculatorImpl implements Caculator {
    @Override
    public int adds(int m, int n) {
//        System.out.println("[日志]:add方法开始执行...");
        int result = m + n;
        System.out.println("方法内部=" + result);
//        System.out.println("[日志]:add方法执行结束...");
        return result;
    }

    @Override
    public int sub(int m, int n) {
//        System.out.println("[日志]:sub方法开始执行...");
        int result = m - n;
        System.out.println("方法内部=" + result);
//        System.out.println("[日志]:sub方法执行结束...");
        return result;
    }

    @Override
    public int mul(int m, int n) {
//        System.out.println("[日志]:mul方法开始执行...");
        int result = m * n;
        System.out.println("方法内部=" + result);
//        System.out.println("[日志]:mul方法执行结束...");
        return result;
    }

    @Override
    public int div(int m, int n) {
//        System.out.println("[日志]:div方法开始执行...");
        int result = m / n;
        System.out.println("方法内部=" + result);
//        System.out.println("[日志]:div方法执行结束...");
        return result;
    }
}
